<template>
  <div>
  
    <el-table
      :data="arr"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      border
      :tree-props="{ children: 'children' }"
    >
      <el-table-column prop="id" label="用户编号"  width="180">
      </el-table-column>
       <el-table-column prop="nickname" label="昵称"  width="180">
      </el-table-column>
      <el-table-column prop="phone" label="手机号"  width="180">
      </el-table-column>
   
    
      <el-table-column label="状态" sortable width="180">
        <!-- 作用域插槽 -->
        <template slot-scope="scope">
          <el-button v-if="scope.row.status == 1" type="primary"
            >启用</el-button
          >
          <el-button v-else type="info">禁用</el-button>
        </template>
      </el-table-column>

      <el-table-column prop="name" label="操作" sortable width="180">
        <!-- 作用域插槽 -->
        <template slot-scope="scope">
          <el-button type="primary" @click="willupdate(scope.row.uid)">修改</el-button>
        </template>
      </el-table-column>
    </el-table>
      
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  props: ["arr"],
  data() {
    return {
    
    };
  },
  computed: {
    ...mapGetters({}),
  },
  mounted() {},
  methods: {
    ...mapActions({}),
    // 5.点了编辑
    willupdate(uid){
        this.$emit("willupdate",uid)
    },
  
  },
};
</script>
<style scoped lang="less">
@import "../../../less/index.less";
</style>